package com.spzx.product.controller;

import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.product.service.TestService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "测试接口")
@RestController
@RequestMapping("/test")
public class TestController {
    
    @Autowired
    private TestService testService;


    /**
     * 测试锁 本地锁
     * 解决不了分布式项目中的高并发问题
     * @return
     */
/*    @GetMapping("/testLock")
    public AjaxResult testLockV1() {
        testService.testLockV1();
        return AjaxResult.success();
    }*/
    @GetMapping("/testLock")
    public AjaxResult testLockV2() {
        testService.testLockV2();
        return AjaxResult.success();
    }

    @GetMapping("/xiaomiqiutest")
    public AjaxResult xiaomiqiutest() {
        System.out.println("xiaomiqiutest success");
        return AjaxResult.success();
    }

}